<#assign base=request.contextPath />
<#assign oneLabel="ERP管理">

<#assign twoLabel="合同管理">
<#assign twoUrl=base+"/customer/list">

<#assign leafLabel="合同列表">
<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="${base}/static/assets/css/chosen.css" />
	<#include "/commons/headImport.ftl">
</head>
<body>
<#include "/commons/header.ftl">
<form class="form-horizontal" name="formName">
	<div class="row">
		<div class="col-xs-12">
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1">名称 </label>
				<div class="col-sm-4">
					<input type="text" name="qprojectName" value="${queryVO.qprojectName!''}" class="col-sm-10" />
				</div>
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1">客户姓名</label>
				<div class="col-sm-4">
					<input type="text" name="qcustomerName" value="${queryVO.qcustomerName!''}" class="col-sm-10" />
				</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1">客户公司</label>
				<div class="col-sm-4">
					<input type="text" name="qcustomerCompany" value="${queryVO.qcustomerId!''}" class="col-sm-10" />
				</div>
				<label class="col-sm-2 control-label no-padding-right" for="form-field-1">责任人</label>
				<div class="col-sm-4">
					<input type="text" name="qpersonLiable" value="${queryVO.qpersonLiable!''}" class="col-sm-10" />
				</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<div class="col-sm-4orm-group center">
					<label class="col-sm-2 control-label no-padding-right" for="form-field-1"></label>
					<div class="col-sm-4"></div>
					<button class="btn btn-xs btn-success" type="button" id="search_id" url="${base}/contract/list">
						<i class="icon-search icon-on-right bigger-110"></i>查询
					</button>
					<button class="btn btn-xs" type="reset" id="reset_id" url="${base}/contract/list">
						<i class="icon-undo bigger-110"></i>重置
					</button>
				</div>
			</div>
			<div class="space-4"></div>
		
			<div>
				<@shiro.hasPermission name="/contract/add">
				<a class="btn btn-minier btn-success" id="to_add_id" url="${base}/contract/add">
					<i class="icon-plus bigger-110"></i>新增合同
				</a>
				</@shiro.hasPermission>
				<@shiro.hasPermission name="/contract/receivables">
				<a class="btn btn-minier btn-success disabled cost_class" id="rece_id" url="${base}/contract/receivables/">
					<i class="icon-edit bigger-110"></i>合同收款
				</a>
				</@shiro.hasPermission>
				<@shiro.hasPermission name="/contract/other">
				<a class="btn btn-minier btn-success disabled cost_class" id="other_id" url="${base}/contract/other/">
					<i class="icon-edit bigger-110"></i>其他支出
				</a>
				</@shiro.hasPermission>
			</div>
			<div class="space-4"></div>
			
			<div class="table-responsive">
				<table class="table table-striped table-bordered table-hover">
					<thead>
						<tr>
							<th class="center" width="5%">#</th>
							<th width="17%">名称</th>
							<th width="9%">地址</th>
							<th width="5%">总金额</th>
							<th width="5%">已收金额</th>
							<th width="9%">签约日期</th>
							<th width="10%">客户公司</th>
							<th width="7%">客户姓名</th>
							<th width="8%">客户电话</th>
							<th width="6%">负责人</th>
							<th width="6%">进度</th>
							<th width="18%"></th>
						</tr>
					</thead>
					<tbody>
					<#if pr??>
						<#list pr.data as data>									
						<tr>
							<td class="center">
								<label>
									<input name="qradio" <#if qradio?? && qradio==data.id>checked</#if> value="${data.id}" type="radio" class="ace" />
									<span class="lbl"></span>
								</label>
							</td>
							<td>
								<@shiro.hasPermission name="/contract/get">
								<a href="javascript:get('${base}/contract/get/${data.id}');">
								</@shiro.hasPermission>
								${data.projectName}
								<@shiro.hasPermission name="/contract/get">
								</a>
								</@shiro.hasPermission>
							</td>
							<td title="${data.projectAddress}">
								<#if (data.projectAddress?length > 5)>${data.projectAddress?substring(0,5)}..<#else>${data.projectAddress}</#if>
							</td>
							<td>${((data.pageTotalAmount)?string.currency)!0.0}</td>								
							<td>${((data.confirmAmount/100.0)?string.currency)!0.0}</td>								
							<td>${(data.signDate?string('yyyy-MM-dd'))!'--'}</td>
							<td>${data.customerDO.companyName!'-'}</td>
							<td>${data.customerName!'-'}</td>
							<td>${data.customerTel!'--'}</td>
							<td>${data.personLiable!'--'}</td>
							<td>${(statusMap['${data.status}'])!'-'}</td>
							<td>
								<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
									<@shiro.hasPermission name="/contract/edit">
									<a class="btn btn-minier btn-success" href="javascript:get('${base}/contract/edit/${data.id}');" title="编辑">
										<i class="icon-edit bigger-120"></i>编辑
									</a>
									</@shiro.hasPermission>
									<@shiro.hasPermission name="/contract/delete">
									<a class="btn btn-minier btn-danger id-btn-dialog2" 
										data='({"url":"${base}/contract/delete/${data.id}","form":"formName"})' 
										href="javascript:void(0);" title="删除">
										<i class="icon-trash bigger-120"></i>删除
									</a>
									</@shiro.hasPermission>
								</div>
							</td>
						</tr>
						</#list>
					</#if>
					<#if ((pr.data)?size==0)>
						<tr>
							<td colspan="18" class="center">没有查询任何数据</td>
						</tr>
					</#if>
					</tbody>
				</table>
			<@p.p pageParam=pr toURL="${base}/contract/list" formName="formName"/>
		</div><!-- /.table-responsive -->
	</div><!-- /span -->
</div><!-- /row -->
</form>
<#include "/commons/footer.ftl">
<script src="${base}/static/assets/js/chosen.jquery.min.js"></script>
<script src="${base}/static/js/erp/contract.js"></script>
</body>
</html>
